Repository navigation
ignore events relays send that weren't asked for - #21
Merged
Merged
Conversation
a relay could answer a lookup with a verification of a different file, or any other signed event, and it would be listed as verifying this one. like the web page, whose relay pool drops events that don't match the subscription's filters, every client now has nostr-sdk check that each event matches what was asked for. > made with claude code + tinfoil hash · session `cac618d4-34cf-4f09-bff6-b4a25528953f` Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
a relay could answer a lookup with a verification of a different file, or any other signed event, and the cli would list it as verifying this one. a malicious or compromised file relay could use that to show a bad file as verified by someone you follow. the web app isn't affected: its relay pool (nostr-tools) drops events that don't match the subscription's filters.
the cli now does the same. every client comes from
relay_connector::build_client(), which turns on nostr-sdk'sverify_subscriptions. that covers the verification lookup, the profile fetched before publishing, and the "already verified?" check, which a relay could otherwise fool into skipping a publish.the new tests use nostr-sdk's mock relay in a mode that answers every request with random text notes. both fail without the fix.